package com.freestyle.nettychat.chat.service;

import com.freestyle.redis.expire.RedisExpirationTemplate;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * Created by rocklee on 2022/2/5 11:42
 */
public class RedisChatServiceFactory extends AbstractChatServiceFactory {
  private RedisExpirationTemplate<String,Object> redisExpirationTemplate;

  public RedisChatServiceFactory(RedisExpirationTemplate<String, Object> redisExpirationTemplate) {
    this.redisExpirationTemplate = redisExpirationTemplate;
  }

  @Override
  public ChatService buildChatService() {
    return new RedisChatService(redisExpirationTemplate);
  }
}
